package com.example.sprotsapi.Service;

import com.example.sprotsapi.Dao.userDao;
import com.example.sprotsapi.Pojo.user;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class userService {

    @Autowired
    userDao userDao;

    public List<user> getAll() {
        return userDao.getAll();
    }

    public List<user> pages(Integer pageNum,Integer pageSize) {
        return userDao.pages(pageNum,pageSize);
    }

    public void setUser(user user){
        userDao.setUser(user);
    }

    public user getUser(Integer uid){
      return userDao.getUser(uid);
    }

    public void delUser(Integer uid){
        userDao.delUser(uid);
    }

    public void updateUser(user user){
        userDao.updateUser(user);
    }

    public user getUserName(String username){
        return userDao.getUserName(username);
    }
    public user getUserPhone(String phone){
        return userDao.getUserPhone(phone);
    }

    public user login(String phone,String password){
        return userDao.login(phone,password);
    }


}
